package com.zh.note.huawei.twohundred.数字序列比大小;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @Author: zhanghuan
 * @date: 2023/8/24 10:26
 * @description: create it
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        String s1 = sc.nextLine();
        String s2 = sc.nextLine();
        String[] s = s1.split(" ");
        int[] a = Arrays.stream(s).mapToInt(Integer::parseInt).toArray();
        String[] s3 = s2.split(" ");
        int[] b = Arrays.stream(s3).mapToInt(Integer::parseInt).toArray();
        Arrays.sort(a);
        Arrays.sort(b);
        int i = 0;
        int count = 0;
        // 4 8 10
        // 4 6 11 j
        for (int j = 0; j < b.length; j++) {
            if (a[i] > b[j]) {
                i++;
                count++;
            } else if (a[i] == b[j]) {
                i++;
            }
        }
        System.out.println(count);

    }
}
